PASO 16: Para calcular hacia dónde debe ir nuestra pelota, necesitamos una nueva coordenada y. bally (nuestra posición actual) + rise (hasta dónde nos movemos hacia arriba) es la respuesta. ¡Pero usar rise pondrá la pelota en la red cada vez! Necesitamos usar cuál sería el aumento con la pendiente que el usuario adivinó. Para obtener nuestro nuevo aumento, usaremos la estimación de la pendiente = aumento/ejecución y resolveremos el aumento.
En LÓGICA, haga clic en y arrastra Multiplication .
Cambie my_var a newrise , y reemplace 2*3 con slopeguess*run .
To navigate the page using the TAB key, first press ESC to exit the code editor.
t = codesters.Teacher()
newrises = t.find_text("newrise")
try:
tval1 = newrises[0][1].replace(" ", "")
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == "newrise=slopeguess*run" , "Great Job!")
t1.add_failure(tval1 == "DNE", "Did you drag out Multiplication and change my_var to newrise?")
t1.add_failure("*" not in tval1, "Did you drag out a Multiplication command?")
t1.add_failure("slopeguess" not in tval1, "Did you change the 2 to slopeguess?")
t1.add_failure("run" not in tval1, "Did you change the 3 to run?")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.